Skip to content

Create GitHub action workflows#44

Merged
omaralalwi merged 3 commits into
deepseek-php:masterfrom
moassaad:create-github-action-workflows
May 22, 2026
Merged

Create GitHub action workflows#44
omaralalwi merged 3 commits into
deepseek-php:masterfrom
moassaad:create-github-action-workflows

Conversation

@moassaad
Copy link
Copy Markdown
Contributor

My contribution regarding an automation to check the static code and it has many features:-

  • Make sure there are no errors that cause the code to crash using phpstan package.
  • Detect errors when uploaded to fix them as soon as possible.
  • Make sure it is free of syntax errors.

moassaad and others added 3 commits March 10, 2025 22:27
…suite

- Bump actions/checkout to v4 (v2 is deprecated).
- Add matrix strategy across PHP 8.1, 8.2, 8.3, 8.4 to match the
  package's `^8.1.0` constraint, with fail-fast disabled so all
  versions report independently.
- Use ramsey/composer-install@v3 for Composer dependency caching keyed
  by composer.lock and PHP version.
- Add concurrency group with cancel-in-progress to save CI minutes
  when pushes/PRs are superseded.
- Replace the single PHPStan step with separate steps for lint
  (Pint --test), static analysis (PHPStan), type coverage (Pest), and
  unit tests (Pest), mirroring `composer test` locally and surfacing
  failures by category in the Actions UI.
- Drop the redundant `test:standard-src-code` composer script in favor
  of the existing `test:types` script (`phpstan analyse --ansi`), which
  the workflow now invokes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@omaralalwi
Copy link
Copy Markdown
Member

omaralalwi commented May 22, 2026

Thanks for kicking this off, @moassaad! I pushed an enhancement commit on top of your branch (maintainer-edit is enabled on this PR, so authorship credit stays with you).

What changed

  • Bumped actions/checkout to v4 (v2 is deprecated).
  • Matrix across PHP 8.1, 8.2, 8.3, 8.4 to match the package's ^8.1.0 constraint. fail-fast: false so every PHP version reports independently.
  • Composer caching via ramsey/composer-install@v3, keyed by composer.lock + PHP version.
  • concurrency group with cancel-in-progress to save CI minutes when pushes/PRs are superseded.
  • Replaced the single PHPStan step with separate steps that mirror composer test:
    • Lint: composer test:lint (Pint --test)
    • Static analysis: composer test:types (PHPStan)
    • Type coverage: composer test:type-coverage (Pest --type-coverage --min=100)
    • Unit tests: composer test:unit (Pest)
  • Dropped the new test:standard-src-code composer script in favor of the existing test:types script (phpstan analyse --ansi), which is functionally equivalent and avoids fragmenting the script list.

Why

The goal is to make community contributions self-validating: every push and PR will exercise lint, static analysis, type coverage, and unit tests across every supported PHP version, so reviewers see a clear pass/fail per category instead of having to run things locally.

Heads-up on the first run

Three steps may surface pre-existing issues the first time the workflow runs against master:

  1. test:lint (Pint) will fail if any currently committed file doesn't match Pint's defaults.
  2. test:types (PHPStan) may surface findings since there is no phpstan.neon in the repo (it runs at the default level).
  3. test:type-coverage requires 100% type coverage. If src/ isn't fully typed today, this step will fail.

If any of those fail, options are: add the missing types/format, lower the threshold in composer.json, or drop the relevant step from the workflow. Happy to follow up in a separate PR once we see the first run.

@omaralalwi omaralalwi merged commit dfa2f69 into deepseek-php:master May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants